package o;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import com.huawei.fastengine.fastview.download.utils.PackageUtils;

public class enp {
    public static int ˊ(Context context) {
        PackageInfo ˎ = ˎ(context, PackageUtils.HWGAMEBOX_PACKAGE_NAME);
        if (ˎ != null) {
            return ˎ.versionCode;
        }
        return -1;
    }

    public static PackageInfo ˎ(Context context, String str) {
        PackageInfo packageInfo = null;
        try {
            packageInfo = context.getPackageManager().getPackageInfo(str, 16384);
        } catch (NameNotFoundException e) {
            Logger.e("GameH5Helper", "getPackageInfo error: " + e.toString());
        }
        return packageInfo;
    }
}
